package com.xxx.mall.dto;

import com.xxx.mall.group.Update;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * @author 邢晨旭
 * {@code @date} 2023/11/17
 */
@Data
public class CategoryDTO {

    @NotNull(message = "分类id不能为空", groups = Update.class)
    private Long categoryId;

    @NotNull(message = "店铺id不能为空")
    private Long shopId;

    @NotNull(message = "父ID不能为空")
    private Long parentId;

    @NotBlank(message = "分类名称不能为空")
    private String name;

    private String desc;

    private String icon;

    private String imgUrl;

    @Range(min = 0, max = 2, message = "分类级别只能为0、1、2")
    private Integer level;

    @Min(value = 0, message = "排序值不能小于0")
    @NotNull(message = "排序值不能为空")
    private Integer seq;


}
